package com.ruoyi.web.utils;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
    private Boolean status;
    private Integer code;
    private String message;
    private Object data;

    public static Result succeed(){
        return new Result(true,100,"成功",null);
    }
    public static Result succeed(String message){
        return new Result(true,100,message,null);
    }
    public static  Result succeed(String message,Object data){
        return new Result(true,100,message,data);
    }


    public  static Result error(){
        return new Result(false,200,"失败",null);
    }
    public static  Result error(String message){
        return new Result(false,200,message,null);
    }
    public static  Result error(String message,Object data){
        return new Result(false,200,message,data);
    }

    public static Result succeed(Object data){
        return new Result(true,100,"成功",data);
    }

}
